From: Bastian Blank Date: Sun, 22 Feb 2009 14:39:35 +0000 (+0100) Subject: kbuild: Make the toolchain variables easily overwritable X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~11^2~115 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=fa65d6adfed9c81ded6f7a19d1e858681c4bb869;p=linux-4.9.git kbuild: Make the toolchain variables easily overwritable Allow make variables to be overridden for each flavour by a file in the build tree, .kernelvariables. We currently use this for ARCH, KERNELRELEASE, CC, and in some cases also CROSS_COMPILE, CFLAGS_KERNEL and CFLAGS_MODULE. This file can only be read after we establish the build tree, and all use of $(ARCH) needs to be moved after this. Gbp-Pq: Topic debian Gbp-Pq: Name kernelvariables.patch --- diff --git a/Makefile b/Makefile index 6989fd8c7d7f..dd5c76b2ac1d 100644 --- a/Makefile +++ b/Makefile @@ -255,42 +255,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ ARCH ?= $(SUBARCH) CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) -# Architecture as present in compile.h -UTS_MACHINE := $(ARCH) -SRCARCH := $(ARCH) - -# Additional ARCH settings for x86 -ifeq ($(ARCH),i386) - SRCARCH := x86 -endif -ifeq ($(ARCH),x86_64) - SRCARCH := x86 -endif - -# Additional ARCH settings for sparc -ifeq ($(ARCH),sparc32) - SRCARCH := sparc -endif -ifeq ($(ARCH),sparc64) - SRCARCH := sparc -endif - -# Additional ARCH settings for sh -ifeq ($(ARCH),sh64) - SRCARCH := sh -endif - -# Additional ARCH settings for tile -ifeq ($(ARCH),tilepro) - SRCARCH := tile -endif -ifeq ($(ARCH),tilegx) - SRCARCH := tile -endif - -# Where to locate arch specific headers -hdr-arch := $(SRCARCH) - KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG @@ -373,6 +337,44 @@ LDFLAGS_vmlinux = CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) +-include $(obj)/.kernelvariables + +# Architecture as present in compile.h +UTS_MACHINE := $(ARCH) +SRCARCH := $(ARCH) + +# Additional ARCH settings for x86 +ifeq ($(ARCH),i386) + SRCARCH := x86 +endif +ifeq ($(ARCH),x86_64) + SRCARCH := x86 +endif + +# Additional ARCH settings for sparc +ifeq ($(ARCH),sparc64) + SRCARCH := sparc +endif + +# Additional ARCH settings for sh +ifeq ($(ARCH),sh64) + SRCARCH := sh +endif + +# Additional ARCH settings for tile +ifeq ($(ARCH),tilepro) + SRCARCH := tile +endif +ifeq ($(ARCH),tilegx) + SRCARCH := tile +endif + +# Where to locate arch specific headers +hdr-arch := $(SRCARCH) + +ifeq ($(ARCH),m68knommu) + hdr-arch := m68k +endif # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \